//
//  DCBaseChatTableViewCell.h
//  xmppTest
//
//  Created by striby on 15/12/30.
//  Copyright © 2015年 com.dc. All rights reserved.
//

#import <UIKit/UIKit.h>

#ifndef DCDeviceWidth
#define DCDeviceWidth [UIScreen mainScreen].bounds.size.width
#endif

#ifndef DCDeviceHeight
#define DCDeviceHeight [UIScreen mainScreen].bounds.size.height
#endif


@protocol DCBaseChatCellProtocol <NSObject>
@required
/**
 *  返回高度
 */
-(CGFloat)cellHeight;

/**
 *  最终呈现时调用
 */
-(void)displayCell;


-(CGFloat)heightFor:(XMPPMessageArchiving_Message_CoreDataObject*)messageObject;

@end

typedef enum _DCChatDirection
{
    DCChatDirectionRight=0,
    DCChatDirectionLeft=1
}DCChatDirection;


static const float baseCellMargin = 5;
static const float userIconWidth = 50;
static const float sendTimeBackgroundHeight = 24;
static const int sendTimeFontSize = 13;
static const int nickNameFontSize = 12;


@interface DCBaseChatTableViewCell : UITableViewCell
{
    DCChatDirection _messageDirection;
}
#pragma mark - commom

/**
*  消息方向 默认为right
*/
-(void)setMessageDirection: (DCChatDirection )messageDirection;

/**
 *  左右边界箭头偏移量
 */
@property(nonatomic,assign)CGFloat constant;

/**
 *  主要显示内容区域
 */
@property(nonatomic,readonly)UIView * baseContentView;

/**
 *  是否显示主区域 默认为YES
 */
@property(nonatomic,assign,readwrite)BOOL isDisplayBaseContnentView;

/**
 *  初始化部分视图
 */
-(void)loadBaseUI;
#pragma mark - sub
/**
 *  是否显示头像
 */
//@property(nonatomic,assign,readonly)BOOL isDisplayUserIcon;

/**
 *  用户头像
 */
@property(nonatomic,strong,readonly)UIImageView * userIconImageView;

/**
 *  是否显示用户的昵称 默认为YES
 */
@property(nonatomic,assign)BOOL isDisplayUserNickName;

/**
 *  用户昵称 label
 */
@property(nonatomic,strong,readonly) UILabel * nickNameLabel;

/**
 *  是否显示发送时间 默认为YES
 */
@property(nonatomic,assign)BOOL isDisplaySendTime;

/**
 *  显示发送时间的label
 */
@property(nonatomic,strong,readonly)UILabel * sendTimeLbl;

/**
 *  发送时间背景
 */
@property(nonatomic,strong,readonly)UIView * sendTimeBackgroundView;

#pragma mark - 底部浅色区域
/**
 *  底部状态视图
 */
@property(nonatomic,strong,readonly)UIView* bottomStatusView;
/**
 *  底部状态图标
 */
@property(nonatomic,strong,readonly)UIImageView * bottomIconView;
/**
 *   底部状态文字
 */
@property(nonatomic,strong,readonly)UILabel * bottomStatusLbl;
/**
 *  是否显示底部状态 默认为NO
 */
@property(nonatomic,assign,readwrite)BOOL isDisplayBottomStatusView;

@end
